A C C 2 C O M P . T X T Release Notes for Compatibility Layer Microsoft Visual Basic (R) 3.0 -- Microsoft Access (R) 2.0 (C) Copyright Microsoft Corporation, 1994 This document describes the Microsoft Jet Database Engine version 2.0/Visual Basic version 3.0 Compatibility Layer, which enables Visual Basic 3.0 and applications created with Visual Basic 3.0 to use data stored in Microsoft Access 2.0 databases. ------------------------ How To Use This Document ------------------------ To view this document on screen using Microsoft Windows Notepad, maximize the Notepad window. To print this document, open it using Windows Write, Microsoft Word, or another word processor. Then select the entire document and format the text in 10-point Courier font before printing. -------- Contents -------- 1. Summary 2. Installing the Compatibility Layer 3. Limitations of the Compatibility Layer 4. Microsoft Jet Database Engine 1.1 Compatibility Issues 5. Adapting Your .INI Files 6. Availability of Version 2.0 Jet Database Engine Features ----------- 1. Summary ----------- Microsoft Access version 2.0 uses a file format for database (.MDB) files that is different from the format used by Microsoft Access versions 1.1 and 1.0. Microsoft Visual Basic version 3.0 cannot use databases in Microsoft Access 2.0 format. If you want to share .MDB format databases between Microsoft Access 2.0 and Visual Basic 3.0 applications, you must either: ** Keep the .MDB files in 1.1 format, which both Microsoft Access 2.0 and Visual Basic 3.0 can use. ** Install the Jet Database Engine 2.0/Visual Basic 3.0 Compatibility Layer included on this disk. The rest of this document describes the Compatibility Layer. The files on this disk enable Visual Basic 3.0 (Standard or Professional Edition) and applications created with Visual Basic 3.0 to use the version 2.0 Jet database engine to read and write data stored in Microsoft Access 2.0 databases. If your Visual Basic 3.0 application doesn't use Microsoft Access 2.0 databases, you won't significantly benefit from using the Compatibility Layer. If you access remote data through attached tables in databases that use the Jet database engine, you will benefit, but you may need to make minor modifications to the application source code. If you don't have access to the source code, you may want to reconsider converting to the version 2.0 Jet database engine. --------------------------------------- 2. Installing the Compatibility Layer --------------------------------------- Before you begin, make backup copies of the existing Visual Basic 3.0 data access files that will be either replaced or modified. These include the following files. Table 2.1 Files That Are Replaced or Modified by the Compatibility Layer --------------------------------------------------- File Description --------------------------------------------------- VBDB300.DLL Visual Basic to Jet database engine 1.1 interface DLL PDCTJET.DLL Run-time DLL for Crystal Reports PDIRJET.DLL Run-time DLL for Crystal Reports PDOJET.DLL Run-time DLL for Crystal Reports CRW.EXE Crystal Report Designer application VB.INI Visual Basic initialization file SETUPWIZ.INI Setup Wizard initialization file ---------------------------------------------------------- NOTE You may not have all these files on your system; for example, CRW.EXE is included only in the Professional Edition of Visual Basic 3.0. ----------------------------------------------------------- To upgrade your existing Visual Basic 3.0 Standard or Professional Edition to support the version 2.0 Jet database engine, you need the following files. Table 2.2 Files Needed to Upgrade Visual Basic 3.0 ---------------------------------------------------- File Description ---------------------------------------------------- MSAJT200.DLL Version 2.0 Jet database engine MSAJT112.DLL Jet Database Engine 2.0/Visual Basic 3.0 Compatibility Layer VBDB300.DLL Visual Basic to Jet database engine support DLL BTRV200.DLL Btrieve ISAM driver library PDX200.DLL Paradox ISAM driver library XBS200.DLL Microsoft FoxPro ISAM driver library CRWACC20.EXE Program that modifies Crystal Reports files to work with Microsoft Access 2.0 databases SETUP.EXE Application that installs the Compatibility Layer ACC2COMP.TXT This file >>>To install the Compatibility Layer ------------------------------------- 1. Insert the Compatibility Layer disk into drive A. 2. From the File menu in the Windows Program Manager or File Manager, choose Run. 3. Type a:setup 4. Follow the Setup instructions on screen. Once Setup is complete, you may not need to do to anything else to your Visual Basic application, unless you've included code for creating or compacting databases, or code that specifically refers to version 1.1 installable ISAM drivers. Details on how to deal with these and other contingencies are discussed in the following sections. CRWACC20.EXE is an MS-DOS-based program that enables Crystal Reports for Visual Basic to work with the version 2.0 Jet database engine. It modifies the following files: ** CRW.EXE ** PDDBJET.DLL ** PDIRJET.DLL ** PDCTJET.DLL The program looks for these files in the current directory or in a directory passed in as part of the command line when it is run. To modify these files, you must run this program after running Setup. Once the program has modified the files it is of no further use. However, you might reinstall Crystal Reports after you install the Compatibility Layer, so you may want to run the program again later. >>>To run CRWACC20.EXE ---------------------- * At the command prompt, type CRWACC20 For example, if CRW.EXE is in a VB subdirectory called REPORT, you type this: CRWACC20 c:\vb\report If CRWACC20.EXE finds the files in the specified directory, it modifies them. If you don't specify a path, it looks in the current directory. When this program modifies a file, the date for the file is set to the current date. After you run Setup, examine your VB.INI file for references to the Jet database engine 1.1 installable ISAM drivers (BTRV110.DLL, PDX110.DLL, XBS110.DLL). Replace any references to these drivers with the new Jet database engine 2.0 driver names (BTRV200.DLL, PDX200.DLL, XBS200.DLL). If you use the Paradox driver (PDX200.DLL), you must also add the entry "ParadoxNetStyle=3.x" to the [Paradox ISAM] section of the VB.INI file. In addition, you need to modify the .INI files of any executable applications you've created. For example, if you have an application named BREAD.EXE, you'd have to modify the BREAD.INI file as well. For an example of new .INI entries, see Section 5, "Adapting Your .INI Files," later in this document. You should also change the entries in SETUPWIZ.INI to specify the new files used in the Compatibility Layer. SETUPWIZ.INI is used with the Setup Wizard to create distribution disks for your application. Once you've installed the Compatibility Layer, any applications you create that perform data access always use the version 2.0 Jet database engine, even if you're accessing data in earlier .MDB formats or other file formats. Therefore, whenever you distribute an application created in Visual Basic 3.0 that performs data access, you need to include the files listed previously in Table 2.2. (You're free to distribute these files with your application.) For an example of new entries for the SETUPWIZ.INI file, see Section 5, "Adapting Your .INI Files," later in this document. Setup doesn't remove the version 1.1 Jet database engine files from your Windows System directory. If you have no other application using those files (such as Microsoft Access 1.1), you can delete them. As a precaution, however, you may want to rename them or move them to another directory for a few days before deleting them to ensure that no other application uses them. ------------------------------------------ 3. Limitations of the Compatibility Layer ------------------------------------------ Although the Compatibility Layer enables your Visual Basic 3.0 applications to read and write data stored in Microsoft Access 2.0 databases, it doesn't give your applications access to all the new Jet database engine 2.0 objects and features because the existing Visual Basic 3.0 language doesn't support programmatic access to these new features. When your Visual Basic 3.0 application manipulates data in Microsoft Access 2.0 databases, you'll encounter the following limitations: ** New Jet database engine 2.0 errors, which result from new database engine behavior, will be returned as unknown errors ("Reserved error "). The error numbers listed in the error messages are version 2.0 Jet database engine numbers. To determine the message associated with an error number, search for "error codes" in Microsoft Access 2.0 Help. ** Visual Basic version 3.0 doesn't take advantage of any of the new Jet database engine 2.0 properties, objects, or methods. See Section 6, "Availability of Version 2.0 Jet Database Engine Features," at the end of this document for a list of major new features and information about their accessibility from Visual Basic 3.0 applications. ** The version 2.0 Jet database engine supports eight new collating orders (Arabic, Russian, Czech, Greek, Hebrew, Hungarian, Polish, and Turkish), which are unavailable to Visual Basic 3.0. Databases created in any of these languages are available in read-only mode only. Data in the languages may not sort correctly when accessed by Visual Basic. ** The version 2.0 Jet database engine allows the entry of zero-length strings as well as Null values. Because of this, Null values aren't automatically converted to zero-length strings when they're entered into version 2.0 databases. This may cause some updates to fail because of validation rules that require zero-length strings, resulting in a message for an unknown error ("Reserved error "). To fix the error, you have to either use Microsoft Access 2.0 to change the rule or not enter Null data into the database. For more information, see Section 6, "Availability of Version 2.0 Jet Database Engine Features." ** You can't open a dynaset on a remote database (such as a SQL Server database) within a transaction using the version 2.0 Jet database engine. For example, the following code will fail as the dynaset is created: Dim MyDB As Database, MyDS As Dynaset Set MyDB = OpenDatabase("") ' Open user-selected external database. MyDB.BeginTrans ' Begin transaction. Set MyDS = MyDB.CreateDynaset(MyDB.TableDefs(0)) ' Open first table. However, if you attach tables from the remote database to a Microsoft Access database, you can create dynasets on those tables within transactions. (Note that access to remote data is faster if the tables are attached.) ----------------------------------------------------------- 4. Microsoft Jet Database Engine 1.1 Compatibility Issues ------------------------------------------------------------ When you use the Compatibility Layer to access data in version 2.0 format, you should keep the following issues in mind: ** Because the Compatibility Layer is uniquely named (MSAJT112.DLL), it shouldn't cause any problems with applications (such as Microsoft Access 1.1) that use the file MSAJT110.DLL. Jet database engine 1.1 installable ISAM drivers can't be used by the version 2.0 database engine. If the version 1.1 drivers are listed in the [Installable ISAM] section of your .INI file, an error will occur when you attempt to use your application to access data in any of these database formats. ** Visual Basic 3.0 applications that use the version 2.0 Jet database engine may be able to update data in situations in which they previously could not (for example, the "one" side of a one-to-many relationship). However, applications can't update data when the change would orphan records on the many side of a recordset. ** For some new SQL reserved words, you must enclose the word in brackets ([ ]) if you want to use it as part of an identifier (for example, a table or field name) in the context of an SQL string. For a list of the Jet database engine 2.0 SQL reserved words, search Microsoft Access 2.0 Help for "SQL." ** By default, the CreateDatabase function and CompactDatabase statement now create databases in Jet database engine 2.0 format. You can override this default behavior by using the DB_VERSION10 constant (in the file DATACONS.TXT). Using this constant creates a version 1.1 database, not a version 1.0 database. You can't create version 1.0 databases. The following table shows which type of database is created when you use CreateDatabase and CompactDatabase with and without DB_VERSION10. ----------------------------------------------------------------- Jet database engine Creates by default With DB_VERSION10 ----------------------------------------------------------------- Version 1.1 Version 1.1 database Version 1.0 database Version 2.0 Version 2.0 database Version 1.1 database ------------------------------ 5. Adapting Your .INI Files ------------------------------ Your .INI file is used by the Jet database engine to locate driver files. When you're designing your application, the VB.INI file contains entries that point to each of the installable ISAM drivers your application will need. If you're creating an executable Visual Basic 3.0 program, you'll need to create an .INI file for the application that also contains these entries. For example, if your application is named CAT.EXE, you'll need to create an .INI file called CAT.INI and add the necessary entries. Shown below is the default [Installable ISAM] section of the VB.INI file. Although it includes entries for all the installable ISAM drivers, the .INI file you create for your application may need only one of these entries. If you use the Paradox driver (PDX200.DLL), you also need to add a line to the [Paradox ISAM] section of your .INI files. You don't need to change any of the other entries in your .INI files. Default entries for VB.INI and .INI ---------------------------------------------------------------------- [Installable ISAM] Paradox 3.X=C:\VB\PDX200.DLL ;Path of the Paradox 3.x driver Paradox 4.X=C:\VB\PDX200.DLL ;Path of the Paradox 4.x driver FoxPro 2.0=C:\VB\XBS200.DLL ;Path of the Microsoft FoxPro 2.0 driver FoxPro 2.5=C:\VB\XBS200.DLL ;Path of the Microsoft FoxPro 2.5 driver dBASE III=C:\VB\XBS200.DLL ;Path of the dBASE III driver dBASE IV=C:\VB\XBS200.DLL ;Path of the dBASE IV driver Btrieve=C:\VB\BTRV200.DLL ;Path of the Btrieve driver [Paradox ISAM] ParadoxNetStyle=3.x ;Required to open Paradox databases --------------------------------------------------------- NOTE You don't need new ODBC drivers to use the version 2.0 Jet database engine; it works correctly with the ODBC drivers that were included with Visual Basic version 3.0. --------------------------------------------------------- In addition, you can adapt SETUPWIZ.INI to accommodate the new drivers and additional files. You can remove entries for these files: ** MSAJT110.DLL ** MSAES110.DLL ** XBS110.DLL ** PDX110.DLL ** BTRV110.DLL These are the new entries for SETUPWIZ.INI. ---------------------------------------------------- [ACCESS] ; Key used by Setup Wizard ; Jet database engine files file1=MSABC100.DLL file2=MSAJT200.DLL file3=VBDB300.DLL file4=SHARE.EXE:1 ; Jet database engine DLLs require ; 'SHARE.EXE /L:500' in AUTOEXEC.BAT file5=MSAJT112.DLL ; Files used by the Crystal Report (*.RPT) files [PDBJET.DLL] file1=PDBJET.DLL ; Jet database engine DLL for Crystal Reports file2=PDIRJET.DLL ; Jet database engine DLL for Crystal Reports file3=PDCTJET.DLL ; Jet database engine DLL for Crystal Reports file4=MSABC200.DLL ; Jet database engine DLL for Crystal Reports file5=MSAJT200.DLL ; Jet database engine DLL for Crystal Reports file6=VBDB300.DLL ; Visual Basic DLL for Crystal Reports file7=SHARE.EXE:1 ; Jet database engine DLLs require ; 'SHARE.EXE /L:500' in AUTOEXEC.BAT file8=MSAJT112.DLL ; Compatibility Layer ------------------------------------------------------------- 6. Availability of Version 2.0 Jet Database Engine Features ------------------------------------------------------------- This section lists new features of the version 2.0 Jet database engine and indicates whether you can take advantage of them in Visual Basic 3.0 when you use the Compatibility Layer. Cascading Updates and Deletes --------------------------------- In Microsoft Access 2.0, you can specify that updates and/or deletions in referenced fields can be cascaded to all referencing tables. In Visual Basic 3.0, however, you can't specify cascading updates or deletes. Consequently, you must use Microsoft Access 2.0 to set this feature. Note that some errors generated from cascading updates and deletes are returned as reserved errors. Whenever possible, these new errors are mapped to existing errors. Table-Level Validation ---------------------- Field- and record-level validation is now maintained by the Jet database engine. This includes setting table-level validation rules as well as default values. In Visual Basic 3.0, you can't set table-level validation rules or default values. Once these values are set by Microsoft Access 2.0, applications created in Visual Basic 3.0 will see the results. Violations of table-level validation rules generate reserved errors. Zero-Length Strings ------------------- In Microsoft Access 2.0 databases, you can enter a zero- length string ("") to indicate data that is known but doesn't exist. A zero-length string is a string in a Text field containing no characters; it's not the same as Null. Visual Basic converts all zero-length strings to Null. There is no way to enter zero-length strings in Visual Basic 3.0. When table-level validation rules or default values have been set by Microsoft Access to enforce the entry of zero-length strings, Visual Basic 3.0 can't enter Null data into these fields.